<!-- 广告位编辑弹窗 -->
<template>
  <el-drawer
    :title="isUpdate?'修改配置':'添加配置'"
    :visible="visible"
    :size="'calc(100vw - 256px)'"
    :destroy-on-close="true"
    :lock-scroll="false"
    @update:visible="updateVisible">
    <el-form
      ref="form"
      :model="form"
      :rules="rules"
      label-width="170px">
      <el-form-item label="开启以下功能点的sku" prop="sku_list">
        <el-input
          :rows="3"
          clearable
          type="textarea"
          v-model="form.sku_list"
          placeholder="请输入sku,多个以;或换行分开"/>
      </el-form-item>
      <el-row :gutter="15">
        <el-col :sm="12">
          <el-form-item label="所属品牌" prop="brand_code">
            <el-select v-model="form.brand" :disabled="isUpdate?true: false">
              <el-option v-for="(item,index) in config.brand_list" :key="index" :label="item" :value="item"/>
            </el-select>
          </el-form-item>
          <el-form-item label="选择模式" prop="select_mode">
            <el-select v-model="form.select_mode">
              <el-option v-for="item in config.select_mode_list" :key="item.val" :label="item.label" :value="item.val"/>
            </el-select>
          </el-form-item>
        </el-col>
<!--        <el-col :sm="12">-->
<!--              <el-form-item label="是否开启注册环节" prop="evaluation_process">-->
<!--                <el-select v-model="form.register_process">-->
<!--                  <el-option v-for="item in config.register_process_list" :key="item.val" :label="item.label" :value="item.val"/>-->
<!--                </el-select>-->
<!--              </el-form-item>-->
<!--        </el-col>-->
        <el-col :sm="12">
          <el-form-item label="是否开启礼品环节" prop="gift_section">
            <el-select v-model="form.gift_section">
              <el-option v-for="item in config.gift_section_list" :key="item.val" :label="item.label" :value="item.val"/>
            </el-select>
          </el-form-item>
        </el-col>
        <!--      <el-form-item label="是否开启评价环节" prop="evaluation_process">-->
        <!--        <el-select v-model="form.evaluation_process">-->
        <!--          <el-option v-for="item in config.evaluation_process_list" :key="item.val" :label="item.label" :value="item.val"/>-->
        <!--        </el-select>-->
        <!--      </el-form-item>-->

        <el-col :sm="12">
          <el-form-item label="是否开启星级评价环节" prop="star_rating_evaluation">
            <el-select v-model="form.star_rating_evaluation">
              <el-option v-for="item in config.star_rating_evaluation_list" :key="item.val" :label="item.label" :value="item.val"/>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :sm="12">
          <el-form-item label="是否跳转amazon留评环节" prop="jump_amazon_comment">
            <el-select v-model="form.jump_amazon_comment">
              <el-option v-for="item in config.jump_amazon_comment_list" :key="item.val" :label="item.label" :value="item.val"/>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :sm="12">
          <el-form-item v-if="form.jump_amazon_comment ===1" label="开启跳转亚马逊留评的星级等级" prop="jump_amazon_star">
            <el-select v-model="form.jump_amazon_star">
              <el-option v-for="item in config.jump_amazon_star_list" :key="item.val" :label="item.label" :value="item.val"/>
            </el-select>
          </el-form-item>
        </el-col>

      </el-row>



      <!--运营话术-->
      <el-card shadow="never" body-style="padding-top: 5px;">
        <el-tabs v-model="active" class="user-info-tabs">
          <el-tab-pane label="English" name="English">
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="礼品选择页话术"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="register_success_script_1">
                    <el-input v-model="form.gift_select_page_script.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="话术2" prop="register_success_script_2">
                    <el-input v-model="form.gift_select_page_script.script_2" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <el-alert
                    title="点击图片放大查看"
                    type="warning"
                    :closable="false">
                  </el-alert>
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/gift_select_page.png" style="height: 450px">
                      <img slot="reference" src="/static/gift_select_page.png"
                           style="width: 200px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="评论判断页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="comment_page_script_1">
                    <el-input v-model="form.comment_page_script.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="话术2" prop="comment_page_script_2">
                    <el-input v-model="form.comment_page_script.script_2" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/comment_page.png" style="height: 450px">
                      <img slot="reference" src="/static/comment_page.png"
                           style="width: 200px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="引导至Amazon页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="amazon_comment_page_script_1">
                    <el-input v-model="form.amazon_comment_page_script.script_1" autocomplete="off"></el-input>
                  </el-form-item>

                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/guide_amazon_page.png" style="height: 450px">
                      <img slot="reference" src="/static/guide_amazon_page.png"
                           style="width: 200px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="用户填写地址页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="gift_product_page_script_1">
                    <el-input v-model="form.gift_product_page_script.script_1" autocomplete="off"></el-input>
                  </el-form-item>

                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/write_address_page.png" style="height: 450px">
                      <img slot="reference" src="/static/write_address_page.png"
                           style="width: 150px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="中差评话术页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="bad_reviews_script_1">
                    <el-input v-model="form.bad_reviews_script.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/bad_review_page.png" style="height: 350px">
                      <img slot="reference" src="/static/bad_review_page.png"
                           style="width: 150px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>

            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="结束流程页话术"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="gift_end_page_script_1">
                    <el-input v-model="form.gift_end_page_script.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/bad_review_page.png" style="height: 350px">
                      <img slot="reference" src="/static/bad_review_page.png"
                           style="width: 150px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
          </el-tab-pane>
          <el-tab-pane label="German" name="German">
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="礼品选择页话术"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="register_success_script_1">
                    <el-input v-model="form.gift_select_page_script_ger.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="话术2" prop="register_success_script_2">
                    <el-input v-model="form.gift_select_page_script_ger.script_2" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <el-alert
                    title="点击图片放大查看"
                    type="warning"
                    :closable="false">
                  </el-alert>
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/gift_select_page.png" style="height: 450px">
                      <img slot="reference" src="/static/gift_select_page.png"
                           style="width: 200px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="评论判断页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="comment_page_script_1">
                    <el-input v-model="form.comment_page_script_ger.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="话术2" prop="comment_page_script_2">
                    <el-input v-model="form.comment_page_script_ger.script_2" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/comment_page.png" style="height: 450px">
                      <img slot="reference" src="/static/comment_page.png"
                           style="width: 200px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="引导至Amazon页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="amazon_comment_page_script_1">
                    <el-input v-model="form.amazon_comment_page_script_ger.script_1" autocomplete="off"></el-input>
                  </el-form-item>

                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/guide_amazon_page.png" style="height: 450px">
                      <img slot="reference" src="/static/guide_amazon_page.png"
                           style="width: 200px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="用户填写地址页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="gift_product_page_script_1">
                    <el-input v-model="form.gift_product_page_script_ger.script_1" autocomplete="off"></el-input>
                  </el-form-item>

                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/write_address_page.png" style="height: 450px">
                      <img slot="reference" src="/static/write_address_page.png"
                           style="width: 150px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="中差评话术页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="bad_reviews_script_1">
                    <el-input v-model="form.bad_reviews_script_ger.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/bad_review_page.png" style="height: 350px">
                      <img slot="reference" src="/static/bad_review_page.png"
                           style="width: 150px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>

            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="结束流程页话术"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="gift_end_page_script_1">
                    <el-input v-model="form.gift_end_page_script_ger.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/bad_review_page.png" style="height: 350px">
                      <img slot="reference" src="/static/bad_review_page.png"
                           style="width: 150px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
          </el-tab-pane>
          <el-tab-pane label="Italian" name="Italian">
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="礼品选择页话术"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="register_success_script_1">
                    <el-input v-model="form.gift_select_page_script_it.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="话术2" prop="register_success_script_2">
                    <el-input v-model="form.gift_select_page_script_it.script_2" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <el-alert
                    title="点击图片放大查看"
                    type="warning"
                    :closable="false">
                  </el-alert>
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/gift_select_page.png" style="height: 450px">
                      <img slot="reference" src="/static/gift_select_page.png"
                           style="width: 200px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="评论判断页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="comment_page_script_1">
                    <el-input v-model="form.comment_page_script_it.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="话术2" prop="comment_page_script_2">
                    <el-input v-model="form.comment_page_script_it.script_2" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/comment_page.png" style="height: 450px">
                      <img slot="reference" src="/static/comment_page.png"
                           style="width: 200px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="引导至Amazon页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="amazon_comment_page_script_1">
                    <el-input v-model="form.amazon_comment_page_script_it.script_1" autocomplete="off"></el-input>
                  </el-form-item>

                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/guide_amazon_page.png" style="height: 450px">
                      <img slot="reference" src="/static/guide_amazon_page.png"
                           style="width: 200px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="用户填写地址页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="gift_product_page_script_1">
                    <el-input v-model="form.gift_product_page_script_it.script_1" autocomplete="off"></el-input>
                  </el-form-item>

                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/write_address_page.png" style="height: 450px">
                      <img slot="reference" src="/static/write_address_page.png"
                           style="width: 150px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="中差评话术页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="bad_reviews_script_1">
                    <el-input v-model="form.bad_reviews_script_it.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/bad_review_page.png" style="height: 350px">
                      <img slot="reference" src="/static/bad_review_page.png"
                           style="width: 150px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>

            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="结束流程页话术"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="gift_end_page_script_1">
                    <el-input v-model="form.gift_end_page_script_it.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/bad_review_page.png" style="height: 350px">
                      <img slot="reference" src="/static/bad_review_page.png"
                           style="width: 150px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
          </el-tab-pane>
          <el-tab-pane label="Spanish" name="Spanish">
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="礼品选择页话术"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="register_success_script_1">
                    <el-input v-model="form.gift_select_page_script_sp.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="话术2" prop="register_success_script_2">
                    <el-input v-model="form.gift_select_page_script_sp.script_2" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <el-alert
                    title="点击图片放大查看"
                    type="warning"
                    :closable="false">
                  </el-alert>
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/gift_select_page.png" style="height: 450px">
                      <img slot="reference" src="/static/gift_select_page.png"
                           style="width: 200px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="评论判断页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="comment_page_script_1">
                    <el-input v-model="form.comment_page_script_sp.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="话术2" prop="comment_page_script_2">
                    <el-input v-model="form.comment_page_script_sp.script_2" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/comment_page.png" style="height: 450px">
                      <img slot="reference" src="/static/comment_page.png"
                           style="width: 200px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="引导至Amazon页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="amazon_comment_page_script_1">
                    <el-input v-model="form.amazon_comment_page_script_sp.script_1" autocomplete="off"></el-input>
                  </el-form-item>

                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/guide_amazon_page.png" style="height: 450px">
                      <img slot="reference" src="/static/guide_amazon_page.png"
                           style="width: 200px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="用户填写地址页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="gift_product_page_script_1">
                    <el-input v-model="form.gift_product_page_script_sp.script_1" autocomplete="off"></el-input>
                  </el-form-item>

                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/write_address_page.png" style="height: 450px">
                      <img slot="reference" src="/static/write_address_page.png"
                           style="width: 150px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="中差评话术页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="bad_reviews_script_1">
                    <el-input v-model="form.bad_reviews_script_sp.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/bad_review_page.png" style="height: 350px">
                      <img slot="reference" src="/static/bad_review_page.png"
                           style="width: 150px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>

            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="结束流程页话术"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="gift_end_page_script_1">
                    <el-input v-model="form.gift_end_page_script_sp.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/bad_review_page.png" style="height: 350px">
                      <img slot="reference" src="/static/bad_review_page.png"
                           style="width: 150px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
          </el-tab-pane>
          <el-tab-pane label="Japanese" name="Japanese">
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="礼品选择页话术"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="register_success_script_1">
                    <el-input v-model="form.gift_select_page_script_jp.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="话术2" prop="register_success_script_2">
                    <el-input v-model="form.gift_select_page_script_jp.script_2" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <el-alert
                    title="点击图片放大查看"
                    type="warning"
                    :closable="false">
                  </el-alert>
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/gift_select_page.png" style="height: 450px">
                      <img slot="reference" src="/static/gift_select_page.png"
                           style="width: 200px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="评论判断页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="comment_page_script_1">
                    <el-input v-model="form.comment_page_script_jp.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="话术2" prop="comment_page_script_2">
                    <el-input v-model="form.comment_page_script_jp.script_2" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/comment_page.png" style="height: 450px">
                      <img slot="reference" src="/static/comment_page.png"
                           style="width: 200px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="引导至Amazon页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="amazon_comment_page_script_1">
                    <el-input v-model="form.amazon_comment_page_script_jp.script_1" autocomplete="off"></el-input>
                  </el-form-item>

                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/guide_amazon_page.png" style="height: 450px">
                      <img slot="reference" src="/static/guide_amazon_page.png"
                           style="width: 200px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="用户填写地址页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="gift_product_page_script_1">
                    <el-input v-model="form.gift_product_page_script_jp.script_1" autocomplete="off"></el-input>
                  </el-form-item>

                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/write_address_page.png" style="height: 450px">
                      <img slot="reference" src="/static/write_address_page.png"
                           style="width: 150px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="中差评话术页"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="bad_reviews_script_1">
                    <el-input v-model="form.bad_reviews_script_jp.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/bad_review_page.png" style="height: 350px">
                      <img slot="reference" src="/static/bad_review_page.png"
                           style="width: 150px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>

            </el-row>
            <el-row :gutter="15" class="script_style">
              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div>
                    <el-alert
                      title="结束流程页话术"
                      type="warning"
                      :closable="false">
                    </el-alert>
                  </div>
                  <el-form-item label="话术1" prop="gift_end_page_script_1">
                    <el-input v-model="form.gift_end_page_script_jp.script_1" autocomplete="off"></el-input>
                  </el-form-item>
                </el-card>
              </el-col>

              <el-col style="float: left" :md="12" :sm="16">
                <el-card shadow="never" body-style="padding-top: 5px;">
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="/static/bad_review_page.png" style="height: 350px">
                      <img slot="reference" src="/static/bad_review_page.png"
                           style="width: 150px; cursor:pointer">
                    </el-popover>
                  </div>
                </el-card>
              </el-col>
            </el-row>
          </el-tab-pane>
        </el-tabs>
      </el-card>




      <br/>
        <div style="text-align: center">
          <el-button @click="updateVisible(false)">取消</el-button>
          <el-button
            type="primary"
            @click="save"
            :loading="loading">保存
          </el-button>
        </div>

    </el-form>

  </el-drawer>
</template>

<script>
import '@riophae/vue-treeselect/dist/vue-treeselect.css';

export default {
  name: 'operateEdit',
  components: {},
  props: {
    // 弹窗是否打开
    visible: Boolean,
    // 修改回显的数据
    data: Object,
    configList: Object,
    // 栏目数据
    cateList: Array
  },
  data() {
    return {
      // tab页选中
      active: 'English',
      // 表单数据
      form: Object.assign({
        select_mode:1,
        evaluation_process: 1,
        gift_section:1,
        star_rating_evaluation:1,
        jump_amazon_comment:1,
        jump_amazon_star:4,
        register_page_script_operate:{
          script_1:''
        },
        process_end_page_script_operate:{
          script_1:''
        },
        register_page_script:{
          script_1:'',
          script_2:'',
        },
        register_success_page_script:{
          script_1:'',
        },
        register_no_page_script:{
          script_1:'',
        },
        gift_select_page_script:{
          script_1:'',
          script_2:'',
        },
        gift_select_page_script_ger:{
          script_1:'',
          script_2:''
        },
        gift_select_page_script_it:{
          script_1:'',
          script_2:''
        },
        gift_select_page_script_sp:{
          script_1:'',
          script_2:''
        },
        gift_select_page_script_jp:{
          script_1:'',
          script_2:''
        },
        bad_reviews_script:{
          script_1:'',
        },
        bad_reviews_script_ger:{
          script_1:'',
        },
        bad_reviews_script_it:{
          script_1:'',
        },
        bad_reviews_script_sp:{
          script_1:'',
        },
        bad_reviews_script_jp:{
          script_1:'',
        },
        comment_page_script:{
          script_1:'',
          script_2:'',
          script_3:'',
          script_4:'',
        },
        comment_page_script_ger:{
          script_1:'',
          script_2:'',
        },
        comment_page_script_it:{
          script_1:'',
          script_2:'',
        },
        comment_page_script_sp:{
          script_1:'',
          script_2:'',
        },
        comment_page_script_jp:{
          script_1:'',
          script_2:'',
        },
        gift_product_page_script:{
          script_1:'',
        },
        gift_product_page_script_ger:{
          script_1:'',
        },
        gift_product_page_script_it:{
          script_1:'',
        },
        gift_product_page_script_sp:{
          script_1:'',
        },
        gift_product_page_script_jp:{
          script_1:'',
        },
        gift_end_page_script:{
          script_1:'',
          script_2:'',
        },
        gift_end_page_script_ger:{
          script_1:'',
        },
        gift_end_page_script_it:{
          script_1:'',
        },
        gift_end_page_script_sp:{
          script_1:'',
        },
        gift_end_page_script_jp:{
          script_1:'',
        },
        amazon_comment_page_script:{
          script_1:'',
        },
        amazon_comment_page_script_ger:{
          script_1:'',
        },
        amazon_comment_page_script_it:{
          script_1:'',
        },
        amazon_comment_page_script_sp:{
          script_1:'',
        },
        amazon_comment_page_script_jp:{
          script_1:'',
        },
      }, this.data),
      config: Object.assign({}, this.configList),
      // 表单验证规则
      rules: {
        user_id: [
          {required: true, message: '请选择用户', trigger: 'blur'}
        ],
        email_name: [
          {required: true, message: '请选择邮箱', trigger: 'blur'}
        ],
        email_pass: [
          {required: true, message: '请选择密码', trigger: 'blur'}
        ]
      },
      // 提交状态
      loading: false,
      // 是否是修改
      isUpdate: false
    };
  },
  watch: {
    data() {
      if (this.data) {
        this.form = Object.assign({}, this.data);
        this.isUpdate = true;
      } else {
        this.form = {
          evaluation_process: 1,
          gift_section:1,
          star_rating_evaluation:1,
          jump_amazon_comment:1,
          jump_amazon_star:4,
          register_page_script_operate:{
            script_1:''
          },
          process_end_page_script_operate:{
            script_1:''
          },
          register_page_script:{
            script_1:'',
          },
          bad_reviews_script:{
            script_1:'',
          },
          bad_reviews_script_ger:{
            script_1:'',
          },
          bad_reviews_script_it:{
            script_1:'',
          },
          bad_reviews_script_sp:{
            script_1:'',
          },
          bad_reviews_script_jp:{
            script_1:'',
          },
          register_success_page_script:{
            script_1:'',
          },
          register_no_page_script:{
            script_1:'',
          },
          gift_select_page_script:{
            script_1:'',
            script_2:''
          },
          gift_select_page_script_ger:{
            script_1:'',
            script_2:''
          },
          gift_select_page_script_it:{
            script_1:'',
            script_2:''
          },
          gift_select_page_script_sp:{
            script_1:'',
            script_2:''
          },
          gift_select_page_script_jp:{
            script_1:'',
            script_2:''
          },
          comment_page_script:{
            script_1:'',
          },
          comment_page_script_ger:{
            script_1:'',
          },
          comment_page_script_it:{
            script_1:'',
          },
          comment_page_script_sp:{
            script_1:'',
          },
          comment_page_script_jp:{
            script_1:'',
          },
          amazon_comment_page_script:{
            script_1:'',
          },
          amazon_comment_page_script_ger:{
            script_1:'',
          },
          amazon_comment_page_script_it:{
            script_1:'',
          },
          amazon_comment_page_script_sp:{
            script_1:'',
          },
          amazon_comment_page_script_jp:{
            script_1:'',
          },
          gift_product_page_script:{
            script_1:'',
          },
          gift_product_page_script_ger:{
            script_1:'',
          },
          gift_product_page_script_it:{
            script_1:'',
          },
          gift_product_page_script_sp:{
            script_1:'',
          },
          gift_product_page_script_jp:{
            script_1:'',
          },
          gift_end_page_script:{
            script_1:'',
          },
          gift_end_page_script_ger:{
            script_1:'',
          },
          gift_end_page_script_it:{
            script_1:'',
          },
          gift_end_page_script_sp:{
            script_1:'',
          },
          gift_end_page_script_jp:{
            script_1:'',
          }
        };
        this.isUpdate = false;
      }

    },
    configList() {
      if (this.configList) {
        this.config = Object.assign({}, this.configList);
      } else {
        this.config = {};
      }
    }
  },
  methods: {
    /* 下拉树格式化 */
    normalizer(d) {
      return {
        id: d.id,
        label: d.name,
        children: d.children || undefined
      };
    },
    /* 保存编辑 */
    save() {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          this.loading = true;
          this.$http.post('/operate/edit', this.form).then(res => {
            this.loading = false;
            if (res.data.code === 0) {
              this.$message.success(res.data.msg);
              if (!this.isUpdate) {
                // this.form = {};
              }
              this.updateVisible(false);
              this.$emit('done');
            } else {
              this.$message.error(res.data.msg);
            }
          }).catch(e => {
            this.loading = false;
            this.$message.error(e.message);
          });
        } else {
          return false;
        }
      });
    },
    /* 更新visible */
    updateVisible(value) {
      this.$emit('update:visible', value);
    }
  }
}
</script>

<style scoped>
</style>
